The Move Class refactoring allows to move a specified class into another package and automatically corrects all references to the class in the code.
To move a class, first select it in any of the project views and press F6 (Refactoring | Move to...)
Specify a name for the target package and press the "Find Usages" button. IDEA will search for
usages of the selected class and display a result window.
The "Search in comments and strings" option controls whether the name of the class will
be searched in comments and string as well.
When running the "Move to..." command from the Commander, by default, the target package will automatically
be the one from the opposite Commander panel.
The result window displays all found usages of the class being moved.
You may exclude any usage you need from being modified by pressing Delete when the usage is selected.
When pressing Delete on a file or a package node, all usages in this file or package will be excluded.
You may also include previously excluded usages by pressing Insert on a corresponding node.
The usages renamed are:
Press the "Do Move" button (Alt-D) to move the class and rename all specified usages. It will close the preview window upon finishing. If you wish to cancel the operation, press the "Cancel" button (Alt-C).